3.1.5 \(\int \cos (c+d x) (a+a \cos (c+d x)) \, dx\) [5]

Optimal. Leaf size=38 \[ \frac {a x}{2}+\frac {a \sin (c+d x)}{d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

1/2*a*x+a*sin(d*x+c)/d+1/2*a*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {2813} \begin {gather*} \frac {a \sin (c+d x)}{d}+\frac {a \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a x}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + a*Cos[c + d*x]),x]

[Out]

(a*x)/2 + (a*Sin[c + d*x])/d + (a*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+a \cos (c+d x)) \, dx &=\frac {a x}{2}+\frac {a \sin (c+d x)}{d}+\frac {a \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 32, normalized size = 0.84 \begin {gather*} \frac {a (2 (c+d x)+4 \sin (c+d x)+\sin (2 (c+d x)))}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + a*Cos[c + d*x]),x]

[Out]

(a*(2*(c + d*x) + 4*Sin[c + d*x] + Sin[2*(c + d*x)]))/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 38, normalized size = 1.00

method result size
risch \(\frac {a x}{2}+\frac {a \sin \left (d x +c \right )}{d}+\frac {a \sin \left (2 d x +2 c \right )}{4 d}\) \(32\)
derivativedivides \(\frac {a \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\sin \left (d x +c \right ) a}{d}\) \(38\)
default \(\frac {a \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+\sin \left (d x +c \right ) a}{d}\) \(38\)
norman \(\frac {\frac {a \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {a x}{2}+\frac {3 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {a x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) \(82\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+a*cos(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/2*sin(d*x+c)*cos(d*x+c)+1/2*d*x+1/2*c)+sin(d*x+c)*a)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 34, normalized size = 0.89 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a + 4 \, a \sin \left (d x + c\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c)),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*a + 4*a*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 29, normalized size = 0.76 \begin {gather*} \frac {a d x + {\left (a \cos \left (d x + c\right ) + 2 \, a\right )} \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(a*d*x + (a*cos(d*x + c) + 2*a)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (32) = 64\).
time = 0.08, size = 66, normalized size = 1.74 \begin {gather*} \begin {cases} \frac {a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {a \sin {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + a\right ) \cos {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c)),x)

[Out]

Piecewise((a*x*sin(c + d*x)**2/2 + a*x*cos(c + d*x)**2/2 + a*sin(c + d*x)*cos(c + d*x)/(2*d) + a*sin(c + d*x)/
d, Ne(d, 0)), (x*(a*cos(c) + a)*cos(c), True))

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 31, normalized size = 0.82 \begin {gather*} \frac {1}{2} \, a x + \frac {a \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {a \sin \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c)),x, algorithm="giac")

[Out]

1/2*a*x + 1/4*a*sin(2*d*x + 2*c)/d + a*sin(d*x + c)/d

________________________________________________________________________________________

Mupad [B]
time = 0.75, size = 50, normalized size = 1.32 \begin {gather*} \frac {a\,x}{2}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a + a*cos(c + d*x)),x)

[Out]

(a*x)/2 + (3*a*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^3)/(d*(tan(c/2 + (d*x)/2)^2 + 1)^2)

________________________________________________________________________________________